package jzq.spring.di;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author jzq
 * @date 2019/3/14 10:34
 */
public class DIApp {


    @Test
    public void diTest() {
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        TextEditor textEditor = (TextEditor) context.getBean("textEditor");
        textEditor.spellCheck();

        TextEditorSetter textEditorSetter = (TextEditorSetter) context.getBean("textEditorSetter");
        textEditorSetter.spellCheck();
        TextAutowire textAutowire = (TextAutowire) context.getBean("textAutowire");
        textAutowire.spellCheck();
    }
}
